import { fileURLToPath, URL} from 'node:url'

import { defineConfig } from 'vite'

import vue from '@vitejs/plugin-vue'

//关于自动加载组件的插件==========================================新增的
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import {
  ElementPlusResolver
} from 'unplugin-vue-components/resolvers'

// https://vitejs.dev/config/
export default defineConfig({
  base:'/background-management-system-vite-vue3/',
  plugins: [
    vue(),
    AutoImport({//===============================================新增的
      resolvers: [ElementPlusResolver()],
    }),
    Components({//===============================================新增的
      resolvers: [ElementPlusResolver()],
    }),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src',
        import.meta.url))
    },
    extensions:['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json','.vue'] 
  },
  
})